﻿namespace AutoMail.Util
{
    public class ResultfulModel<T>
    {
        /// <summary>
        /// 状态码
        /// </summary>
        public int Status { get; set; }
        /// <summary>
        /// 数据
        /// </summary>
        public T? Data { get; set; }
        /// <summary>
        /// 时间戳
        /// </summary>
        public string TimeStamp { get; set; } = "";
        /// <summary>
        /// 信息
        /// </summary>
        public string? Message { get; set; }
        /// <summary>
        /// 扩展数据
        /// </summary>
        public object? Extend { get; set; }

        public static implicit operator ResultfulModel<T>(T value)
        {
            return new ResultfulModel<T>() { Data = value };
        }
    }
}
